<template>
  <div class="tcm-care">
    <header class="header">
      <div class="back-button" @click="goBack">
        <span>&lt;</span>
      </div>
      <h1>中医护理</h1>
      <div class="right-icons">
        <span class="icon">♡</span>
        <span class="icon">⋯</span>
      </div>
    </header>

    <div class="service-banner">
      <div class="service-info">
        <h2>中医特色护理服务</h2>
      </div>
    </div>

    <div class="service-items-grid">
      <div class="service-item-card" v-for="(item, index) in serviceItems" :key="index" @click="makeAppointment(item.title, 159)">
        <div class="item-title">{{ item.title }}</div>
      </div>
    </div>

    <div class="booking-bar">
      <button class="book-button" @click="makeAppointment()">立即预约</button>
    </div>
  </div>
</template>

<script setup>
import { ref, defineEmits } from 'vue';

const emit = defineEmits(['go-back', 'show-appointment']);

const serviceItems = ref([
  { title: '耳穴压豆调理' },
  { title: '穴位贴敷调理' },
  { title: '艾灸调理' },
  { title: '中药口腔护理' }
]);

const goBack = () => {
  emit('go-back');
};

const makeAppointment = (serviceName, price) => {
  emit('show-appointment', {
    serviceName: serviceName || '中医特色护理服务',
    price: price || 159,
    source: 'tcm-care'
  });
};
</script>

<style scoped>
.tcm-care {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  max-width: 750px;
  margin: 0 auto;
  background-color: #f5f5f5;
  padding-bottom: 0;
  overflow-x: hidden;
  width: 100%;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 15px;
  background-color: #00a163;
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

.back-button {
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header h1 {
  font-size: 18px;
  margin: 0;
  flex: 1;
  text-align: center;
}

.right-icons {
  display: flex;
  gap: 15px;
}

.icon {
  font-size: 20px;
  cursor: pointer;
}

.service-banner {
  background-color: white;
  padding: 15px;
  width: 100%;
}

.service-info h2 {
  font-size: 20px;
  margin: 0 0 10px 0;
}

.service-items-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  padding: 15px;
  background-color: white;
}

.service-item-card {
  background-color: #f0f9f6;
  border-radius: 10px;
  padding: 30px 15px;
  text-align: center;
  cursor: pointer;
  border: 1px solid #e0e0e0;
  transition: all 0.3s ease;
}

.service-item-card:hover {
  background-color: #e6f7f1;
  border-color: #00a163;
}

.item-title {
  font-size: 18px;
  font-weight: bold;
  color: #333;
}

.booking-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
  background-color: white;
  position: fixed;
  bottom: 60px;
  left: 0;
  right: 0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  max-width: 750px;
  margin: 0 auto;
  z-index: 99;
}

.book-button {
  padding: 12px 30px;
  background-color: #ff4d4f;
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 18px;
  width: 90%;
  margin: 0 auto;
  cursor: pointer;
}

@media screen and (max-width: 375px) {
  .service-items-grid {
    gap: 10px;
    padding: 10px;
  }
  
  .service-item-card {
    padding: 25px 10px;
  }
  
  .item-title {
    font-size: 16px;
  }
  
  .book-button {
    font-size: 16px;
    padding: 10px 20px;
  }
}

@media screen and (max-width: 320px) {
  .service-item-card {
    padding: 20px 8px;
  }
  
  .item-title {
    font-size: 14px;
  }
}
</style> 